<!DOCTYPE html>
<html>
    <head>
        <title>职统</title>
        <link rel="stylesheet" href="/styles/common.css"/>
        <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
        <style type="text/css">
            
        </style>
    </head>
    <body>
         <#include "top.ftl">
        <div class="page-body">
            <#include "leftmenu.ftl">
            <div class="page-content">
                <div class="content-nav">
                    会议预定 > 搜索会议
                </div>
                <form action="#">
                    <fieldset>
                        <legend>搜索会议</legend>
                        <table class="formtable">
                            <tr>
                                <td>会议名称：</td>
                                <td>
                                    <input type="text" id="meetingname" maxlength="20" value=""/>
                                </td>
                                <td>会议室名称：</td>
                                <td>
                                    <input type="text" id="roomname" maxlength="20" value=""/>
                                </td>
                                <td>预定者姓名：</td>
                                <td>
                                    <input type="text" id="reservername" maxlength="20" value=""/>
                                </td>
                            </tr>
<#--                            <tr>-->
<#--                                <td>预定日期：</td>-->
<#--                                <td colspan="5">-->
<#--                                    从&nbsp;<input type="date" id="reservefromdate" placeholder="例如：2013-10-20"/>-->
<#--                                    到&nbsp;<input type="date" id="reservetodate" placeholder="例如：2013-10-22"/>-->
<#--                                </td>-->
<#--                            </tr>-->
<#--                            <tr>-->
<#--                                <td>会议日期：</td>-->
<#--                                <td colspan="5">-->
<#--                                    从&nbsp;<input type="date" id="meetingfromdate" placeholder="例如：2013-10-20"/>-->
<#--                                    到&nbsp;<input type="date" id="meetingtodate" placeholder="例如：2013-10-22"/>-->
<#--                                </td>-->
<#--                            </tr>-->
                            <tr>
                                <td colspan="6" class="command">
                                    <input type="button" class="clickbutton" value="查询" onclick="searchmeeting()"/>
                                    <input type="reset" class="clickbutton" value="重置"/>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </form>
                <div>
                    <h3 style="text-align:center;color:black">查询结果</h3>
                    <div class="pager-header">
                        <div class="header-info">
                            共<span class="info-number">${total}</span>条结果，
                            分成<span class="info-number">${pagenum}</span>页显示，
                            当前第<span class="info-number">${page}</span>页
                        </div>
                        <div class="header-nav">
                            <#if page gt 1>
                                <button class="clickbutton"><a href="/searchmeetings?page=1">首页</a></button>
                                <button class="clickbutton"><a href="/searchmeetings?page=${page-1}">上一页</a></button>
                            </#if>
                            <#if page lt pagenum>
                                <button class="clickbutton"><a onclick="nextpage()">下一页</a></button>
                                <button class="clickbutton"><a href="/searchmeetings?page=${pagenum}">末页</a></button>
                            </#if>
                        </div>
                    </div>
                </div>
                <table class="listtable">
                    <tr class="listheader">
                        <th>会议名称</th>
                        <th>会议室名称</th>
                        <th>会议开始时间</th>
                        <th>会议结束时间</th>
                        <th>会议预定时间</th>
                        <th>预定者</th>
                        <th>操作</th>
                    </tr>
                    <#if meetings??>
                        <#list meetings as met>
                            <tr>
                                <td>${met.meetingname}</td>
                                <td>${met.roomname}</td>
                                <td>${(met.starttime)?string('yyyy.MM.dd HH:mm:ss')}</td>
                                <td>${(met.endtime)?string('yyyy.MM.dd HH:mm:ss')}</td>
                                <td>${(met.reservationtime)?string('yyyy.MM.dd HH:mm:ss')}</td>
                                <td>${met.employeename}</td>
                                <td>
                                    <a class="clickbutton" href="/meetingdetails?id=${met.meetingid}">查看详情</a>
                                </td>
                            </tr>
                        </#list>
                    </#if>


                </table>
            </div>
        </div>
        <div class="page-footer">
            <hr/>

        </div>
    </body>
<script>
    function searchmeeting() {
       var meetingname = $("#meetingname").val();
       window.location.href="searchmeetings?page=1&meetingname="+meetingname;

    }
    function nextpage() {
        var searchs = window.location.search;
        searchs = searchs.substring(1);
        let strings = searchs.split("&");
        let pages = strings[0].split("=");
        let page = parseInt(pages[1])+1;
        var meetingname = $("#meetingname").val();
        window.location.href="searchmeetings?page="+page+"&meetingname="+meetingname;

    }
</script>
</html>